#pragma once
#include <functional>
#include <iostream>

//任务形式1
using task_t = std::function<void()>;

void Download()
{
    std::cout << "我是一个下载任务..." << std::endl;
}

//任务形式2
class Task
{
public:
    Task(int x, int y)
        : _x(x),
          _y(y)
    {
    }

    void Execut()
    {
        _result = _x + _y;
    }

    int X() { return _x; }
    int Y() { return _y; }
    int Result() { return _result; }

    ~Task() {}

private:
    int _x;
    int _y;
    int _result;
};